Update provider resources to align with the Spice Cloud API updates#26
Draft
ewgenius wants to merge 1 commit into
Draft
Update provider resources to align with the Spice Cloud API updates#26ewgenius wants to merge 1 commit into
ewgenius wants to merge 1 commit into
Conversation
Add resources and executor attributes to app resource Add channel attribute to deployment resource Update docs for new attributes and schemas
There was a problem hiding this comment.
Pull request overview
Updates the Terraform provider’s app and deployment resources to match recent Spice Cloud API changes, including new configuration fields and updated documentation.
Changes:
- Add
resourcesandexecutornested configuration blocks tospiceai_app, including expand/flatten mappings to API structs. - Add
channeloverride tospiceai_deploymentcreate request and schema. - Remove
api_keyfrom app resource and app data sources, and refresh docs to reflect the new/updated schemas.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| internal/provider/resource_deployment.go | Adds channel attribute to deployment schema/model and sends it on create. |
| internal/provider/resource_app.go | Adds resources and executor schema/model support; implements expand/flatten helpers and wires them into update/read mapping; removes api_key from resource. |
| internal/provider/datasource_apps.go | Removes api_key from the apps list data source model/schema/mapping. |
| internal/provider/datasource_app.go | Removes api_key from the single app data source model/schema/mapping. |
| internal/client/client.go | Extends API client structs for app config (resources, executor) and deployment create (channel); adds new resource/executor structs. |
| docs/resources/deployment.md | Documents new optional channel attribute for deployments. |
| docs/resources/app.md | Documents new resources and executor nested schemas; updates update_channel valid values; removes api_key from read-only attributes. |
| docs/data-sources/apps.md | Removes api_key from apps data source docs. |
| docs/data-sources/app.md | Removes api_key from app data source schema docs (but example usage still references it). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+142
to
+148
| "channel": schema.StringAttribute{ | ||
| MarkdownDescription: "Override the deployment channel for this deployment. Valid values are `stable`. Changing this forces a new deployment to be created.", | ||
| Optional: true, | ||
| PlanModifiers: []planmodifier.String{ | ||
| stringplanmodifier.RequiresReplace(), | ||
| }, | ||
| }, |
Comment on lines
67
to
71
| ### Read-Only | ||
|
|
||
| - `api_key` (String, Sensitive) The API key for the app. | ||
| - `cluster_id` (String) The Kubernetes cluster identifier where the app is deployed. | ||
| - `cname` (String) The region identifier (cname) for the app. | ||
| - `created_at` (String) The timestamp when the app was created. |
Comment on lines
+901
to
+905
| func expandContainerResources(value types.Object) *client.ContainerResources { | ||
| if value.IsNull() || value.IsUnknown() { | ||
| return nil | ||
| } | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Align the Terraform provider with the updated Management API spec.
api_keyfrom:spiceai_appdata.spiceai_appdata.spiceai_appsresourcesandexecutorchannelupdate_channelvalidation to current API values